<?php
namespace app\index\loglic;

class Trans
{
    private $error = '格式错误';

    public function getError()
    {
        return $this->error;
    }
    
    public function init($url='')
    {
        $post = [
            'token' => config('apis.daicuo_token'),
            'url'   => $url,
            'end'   => intval(config('trans.max')),
        ];
        $result = dcCurl('auto',10,'http://api.daicuo.cc/apis/trans/',$post);
        $result = json_decode($result,true);
        if($result['code'] != 200){
            $this->error = $result['msg'];
            return false;
        }
        return $result['data'];
    }
}